<?php
//达人订单
namespace app\adminbackstage\model;

use think\Model;
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

class Order extends Model{

    // 模型初始化
    protected static function init()
    {
        parent::init();
        //TODO:初始化内容
    }
    
    //达人订单列表
    public static function orderList($where,$page,$num){
        $list = self::where($where)
        ->limit(($page-1)*$num,$num)
        ->select();
        return $list;
    }
    
    //达人订单详情
    public static  function orderInfo($where){
        $info = self::where($where)
         ->find();
        return $info;
    }
    
    //达人订单数
    public static function orderCount($where) {
        return self::
        where($where)
        ->count();
    }

    //达人订单修改
    public static function orderEdit($id,$update){
        $in = self::update($update, ['id' => $id]);
        return $in;
    }
    

    //达人订单添加
    public static function orderAdd(array $data){
        return self::create($data);
    }
  
}
